import {
	setToken,
	getToken,
	removeToken
} from '@/utils/token.js'
// import api from '../../api/index.js'
export default {
	state: {
		userInfo: {},
		token: "",
		isLogin: false,
	},
	mutations: {
		GETTOKEN(state, value) {
			state.token = value
			setToken(value)
		},
		GETUSERINFO(state, value) {
			state.userInfo = value
			state.isLogin = true
		},
		LOGOUT(state, value){
			removeToken()
			state.userInfo={}
			state.isLogin=false
			state.token=""
		}
	},
	actions: {
		async getUserInfo({
			commit
		}) {
			console.log("测试vuex");
		}
	}
}